<template>
  <div class="notice-page page">
    <nav-bar title="公告类型" theme="red" search></nav-bar>
    <div class="notice-detail-banner" v-if="flag">
      <img :src="imgUrl" />
    </div>
    <div :class="[flag ? 'isbanner' : 'notice-detail-title']">
      {{ detailData.noticeTitle }}
    </div>
    <div :class="[flag ? 'notice-detail-divisionMargin' : 'notice-detail-division']"></div>
    <div class="notice-detail-user">
      <span class="notice-detail-user-name">{{ detailData.publishPersonName }}</span>
      <span class="notice-detail-user-time">{{ detailData.startTime }}</span>
    </div>
    <div class="notice-detail-content ql-editor" v-html="detailData.noticeContent"></div>
  </div>
</template>
<script>
import Notice from '@/api/notice'
export default {
  components: {},
  data() {
    return {
      detailData: {},
      imgUrl: '',
      flag: false
    }
  },
  created() {
    this.getDetail()
  },
  methods: {
    // 详情
    getDetail() {
      Notice.noticeDetail.detail({ noticeCode: this.$route.query.noticeCode }).then(res => {
        this.detailData = res.data.data[0]
        this.imgUrl = this.$config.ImageURl + this.detailData.bannerImg
        if (this.detailData.isBanner === '1') {
          this.flag = true
        } else {
          this.flag = false
        }
      })
    }
  }
}
</script>
<style lang="less" scoped>
@import '~@/assets/style/notice/detail.less';
</style>
